Passive Linked Table Programming Example

Description

Creating a passive-link table using Xbasic:

'Define the DataSource
 Delete DS
 DIM DS as P
 DS.ConnectionString = "{A5API='Access',A5Syntax='Access',FileName='C:\data\northwind.mdb',UserName='Admin'}"
 DS.SQLSelectStatement = "select * from Customers"
 DS.Arguments = ""

 Dim TableFileName as c 
 TableFileName = "C:\a5data\pl_customers.dbf"
 Dim showProgress as l
 Dim allowCancel as l
 showProgress = .t.
 allowCancel = .t.

 Delete ResultP
 DIM ResultP as p
 ResultP = a5_PassiveLinkTableDefine(DS,TableFilename,showProgress,allowCancel)
 if ResultP.userCancelled = .t. then 
 ui_msg_box("Notice","User cancelled")
 else if ResultP.HasError = .t. then 
 ui_msg_box("Error",resultP.errorText)
 else
 ui_msg_box("Notice","File created: " + resultP.tablefilename)
 end if

Refreshing a passive-link table using Xbasic:

dim pr as p 
pr = a5_RefreshPassiveLinkTable("pl_customers")
if pr.error  = .t. then 
    ui_msg_box("Error",pr.errorText)
end if

Limitations

Desktop applications only.

See Also